import { App } from "vue";

const node_modules_files = import.meta.glob('/node_modules/@xuekl/cli-components/*.vue', { eager: true })

const files = import.meta.glob('./*.vue', { eager: true })

Object.assign(files, node_modules_files)

export default function useComponent(app: App<Element>) {

  Object.keys(files).forEach((component) => {
    const file = (files[component] as any).default

    // 使用内置的组件名称 进行全局组件注册
    app.component(file.name, file)
  })
}